home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / NeXT-Icons / next-icon@gun.com / Apps / mail-notifier / mail-notifier.rtfd / 62131_.notify.glenn next >
Encoding:
Text File  |  1993-12-14  |  954 b   |  35 lines

  1. #! /bin/sh
  2.  
  3. # buff is the name of the buffer file in which to store a 
  4. # temporary copy of the mail header
  5. buff=/tmp/.notify.glenn.buffer
  6.  
  7. # copy the first screenful of the mail message to the buffer
  8. # for later perusal.
  9. head -24 > $buff
  10.  
  11. #######################################################
  12. # Test for conditions that make us not want to play a sound and exit if such
  13. # conditions are found.
  14.  
  15. # Don't make sounds if next-icon@ is in the 'To:' line.
  16. if grep '^To:' | grep '[Nn][Ee][Xx][Tt]-[Ii][Cc][Oo][Nn]@' < $buff > /dev/null; 
  17. then
  18.         rm $buff
  19.         exit 0
  20. fi
  21.  
  22. # Don't make sounds if next-icon@ is in the 'CC:' line.
  23. if grep '^[Cc][Cc]:' | grep '[Nn][Ee][Xx][Tt]-[Ii][Cc][Oo][Nn]@' < $buff > /dev/null; 
  24. then
  25.         rm $buff
  26.         exit 0
  27. fi
  28.  
  29. ########################################################
  30. #If the shell gets this far, play the sound.
  31. cd ~gbrown/Library/Sounds
  32. /usr/local/bin/ifonconsole gbrown '/usr/bin/sndplay Glenn.snd'
  33. rm $buff
  34. exit 0
  35.